<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th class="text-center">
                    <div class="table-first-id">ID</div>
                </th>
                <th class="text-center" width="30%">课程名称</th>
                <th class="text-center" width="25%">专业/科目</th>
                <th class="text-center" width="15%" th:text="${selaSwitch}==3?'原价/售价/会员价(元)':'原价/售价(元)'"></th>
                <th class="text-center" width="5%">类型</th>
                <th class="text-center" width="10%">创建人</th>
                <th class="text-center" width="10%">完结状态</th>
            </tr>
            </thead>
        </table>
        <div class="J_V_tabContent table-xScrollWrap">
            <table class="table table-bordered table-hover table-xs-content">
                <tbody id="tbodyMaterial">
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center">
                        <div class="table-first-id">&nbsp;</div>
                    </th>
                    <th class="text-center" width="30%"></th>
                    <th class="text-center" width="25%"></th>
                    <th class="text-center" width="15%"></th>
                    <th class="text-center" width="5%"></th>
                    <th class="text-center" width="10%"></th>
                    <th class="text-center" width="10%"></th>
                </tr>
                <tr th:if="${#maps.isEmpty(dataMap)} or ${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="10" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有课程数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#maps.isEmpty(dataMap)} and !${#lists.isEmpty(dataMap['list'])}" th:each="course : ${dataMap['list']}" th:attr="id='course-data-'+${course['id']},data-id=${course['id']}" th:attrappend="data-image=${course['imageJson']}">
                    <td class="text-center">
                        <input name="id" th:type="${#strings.isEmpty(selectType)}?'radio':${selectType}" class="i-checks" th:attr="data-orprice=${course['orPrice']}" th:attrappend="data-courseTypeKey=${course['courseTypeKey']},data-name=${course['courseName']},data-image=${course['imageJson']}" th:title="${course['courseName']}" th:value="${course['id']}">
                    </td>
                    <td class="text-center" th:text="${course['courseName']}"></td>
                    <td class="text-center" th:attrappend="id='subject-name-'+${course['id']}">
                        <th:block th:if="!${#lists.isEmpty(course['subjectList'])}">
                            <span class="pie" th:each="subject,subIndex : ${course['subjectList']}">
                                <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                                <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                                    <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                                    <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                                </th:block>
                                <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                                <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                            </span>
                        </th:block>
                        <th:block th:if="${#lists.isEmpty(course['subjectList'])}">
                            <span class="pie">—</span>
                        </th:block>
                    </td>
                    <td class="text-center" th:text="${selaSwitch}==3?${course['orPrice']}+'/'+${course['realPrice']}+'/'+${course['memberPrice']}:${course['orPrice']}+'/'+${course['realPrice']}">价格</td>
                    <td class="text-center">
                        <th:block th:each="courseType :${courseTypeList}">
                            <span th:if="${course['courseTypeKey']}==${courseType.key}" th:text="${courseType.value}"></span>
                        </th:block>
                    </td>
                    <td class="text-center" th:text="!${#maps.isEmpty(course['createUser'])}?${course['createUser']['ralName']}:'—'"></td>
                    <td class="text-center" th:attr="id='context-status-'+${course['id']}">
                        <span th:if="${course['contextStatus']}==1" class="label label-default">未完结</span>
                        <span th:if="${course['contextStatus']}==2" class="label label-info">已完结</span>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <!-- 分页，开始 -->
        <div data-th-replace="layout/adminPage"></div>
        <!-- 分页，结束 -->
    </div>
</html>